R @ MMC

Costas T Lambrew Research Retreat

May 1, 2019

Visualize your data

plots

Create maps!

map

Statistics and machine learning

islr

Programmatically generate tables

tbl_summary(trial[c("trt", "age", "grade", "response")], 
            by = "trt") %>%
  add_comparison() 
Characteristic1 Drug, N = 107 Placebo, N = 93 p-value2
Age, yrs 47 (39, 58) 45 (36, 54) 0.3
Unknown 6 3
Grade 0.3
I 38 (36%) 29 (31%)
II 34 (32%) 24 (26%)
III 35 (33%) 40 (43%)
Tumor Response 53 (51%) 30 (34%) 0.023
Unknown 4 5
1 Statistics presented: median (IQR); n (%)
2 Statistical tests performed: Wilcoxon rank-sum test; chi-square test of independence

MMC R server

Access your work from any MaineHealth computer with a web browser

https://vmrstudiowebap

MMC R server

Install packages with ease

install.packages("tidyverse")

MMC R server

Use Python

import pandas as pd
my_series = pd.Series([2, 4, 6, 8, 10])
print(my_series.describe())
## count     5.000000
## mean      6.000000
## std       3.162278
## min       2.000000
## 25%       4.000000
## 50%       6.000000
## 75%       8.000000
## max      10.000000
## dtype: float64

MMC R server

Connect to databases

con <- dbConnect(odbc(), Driver = "{ODBC Driver 17 for SQL Server}", 
    Server = "localhost", 
    Database = "testdb", 
    UID = "SA", 
    PWD = rstudioapi::askForPassword("Database password"), 
    Port = 1433)

MMC R user group

  • Get help from peers
  • Meets first Tuesday of every month at CORE
  • Upcoming topics
    • Programmatic tables (Next Tuesday)
    • Baysian multilevel modeling
    • Causal inference and Structural Equation Modeling
    • Big data

Data Carpentry Workshop at Core